<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	</body>
	<script>
		var arr = [1, 2, 3, 4, 2, 5, 6, 54, 6, 1, 24, 3]
		for(var i = 0; i < arr.length; i++) {
			for(var j = i + 1; j < arr.length; j++) {
				if(arr[i] == arr[j]) {
					arr.splice(j, 1)
					j--
				}
			}
		}
		document.write(arr+"<br />")
		var arr1 = [1,4,5,2,6,35,32,5,2]
		var arr2 = new Array()
		for(var i = 0; i < arr1.length; i++) {
			if(arr2.indexOf(arr1[i]) == -1) {
				arr2.push(arr[i]);
			}
		}
		document.write(arr2)

	</script>

</html>